import React from "react";
import lazyLoad from "@/routers/utils/lazyLoad";
import { LayoutIndex } from "@/routers/constant";
import { RouteObject } from "@/routers/interface";

// menu 模块
const menuRouter: Array<RouteObject> = [
	{
		element: <LayoutIndex />,
		path: "/analysis-data",
		permissions: ["analysisDataView", "analysisRecoveryView", "analysisView"],
		meta: {
			title: "数据分析",
			icon: "PieChartOutlined",
			sort: 9,
		},
		children: [
			{
				path: "/analysis-data/sale-order",
				element: lazyLoad(React.lazy(() => import("@/views/analysisData/saleOrder/index"))),
				meta: {
					requiresAuth: true,
					icon: "PieChartOutlined",
					title: "销售数据分析",
					key: "analysisDataView"
				}
			},
			{
				path: "/analysis-data/recovery-order",
				element: lazyLoad(React.lazy(() => import("@/views/analysisData/saleOrder/index"))),
				meta: {
					requiresAuth: true,
					icon: "PieChartOutlined",
					title: "回收数据分析",
					key: "analysisRecoveryView"
				}
			},
			{
				path: "/analysis-data/analysis-data",
				element: lazyLoad(React.lazy(() => import("@/views/analysisData/saleOrder/index"))),
				meta: {
					requiresAuth: true,
					icon: "PieChartOutlined",
					title: "经营分析数据",
					key: "analysisView"
				}
			},
		]
	}
];

export default menuRouter;
